473,544 Members | 713 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Message Box. 3 Choices - How ??

Hi

I can create a messagebox that gives you Yes / No options

But I'd like to create one that gives... Yes / No / Maybe

More specifily...

Text in message box will read:

Is this chargeable ?

Yes -> goto page1.html
Cancel -> Cancel
No -> goto page2.html

Can this be done ?

Thanks

Jul 23 '05 #1
3 6385
In article <bj************ *************** *****@4ax.com>, to**@adslweb.co .uk
enlightened us with...
Hi

I can create a messagebox that gives you Yes / No options

But I'd like to create one that gives... Yes / No / Maybe

More specifily...

Text in message box will read:

Is this chargeable ?

Yes -> goto page1.html
Cancel -> Cancel
No -> goto page2.html

Can this be done ?


Not with javascript alert/confirm/prompt.
If this is for MSIE only (intranet/CD/HTA/etc), vbscript may allow it with
MsgBox. I haven't tried it, but plain VB can. Check MSDN.

If this is for the web (cross-browser), you'll have to simulate an alert-type
thing with a floating DIV with buttons that have those options and catch
onClick, or some such workaround.

--
--
~kaeli~
Experience is something you don't get until just after you
need it.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2
kaeli wrote:
If this is for MSIE only (intranet/CD/HTA/etc), vbscript may allow it
with MsgBox.


From trusted applications like HTAs, WScript.Shell's Popup will work, too:

try {
var oWShell, nChoice;
oWShell = new ActiveXObject(" WScript.Shell") ;
nChoice = oWShell.Popup(
"Press YES for page1, NO for page2, or CANCEL to cancel.",
0, "Navigate to another page", 35
);
if (nChoice == 6) {
location.href = "page1.html ";
}
else if (nChoice == 7) {
loction.href = "page2.html ";
}
}
catch(oError) {
if (window.bDebug > 0) {
alert(oError.me ssage);
}
}

ciao, dhgm
Jul 23 '05 #3
Dietmar Meier wrote:
kaeli wrote:
If this is for MSIE only (intranet/CD/HTA/etc), vbscript may allow it
with MsgBox.

From trusted applications like HTAs, WScript.Shell's Popup will work, too:

[...]

To remove the IE-centricity, why not a 'pop-up' div that contains
checkboxes with the relevant items?

The example below writes the value to an input supplied by the call,
but it could just return the selected value.

<style type="text/css">
..pHead, .pTxt
{font-family: arial, sans-serif; font-weight: bold;
background-color: #333366; color: #eeeeff;
margin: 0; padding: 5px 5px 2px 2px;}
..pTxt
{font-weight: normal;}
..pDiv
{color: #333366; background-color: #eeeeff;
position: absolute; border: 1px solid #333366;}
</style>
<script type="text/javascript">
function confirm(){
var a = [];
var i = arguments.lengt h;
while (i-- && (a[i] = arguments[i]) );
var src = a.shift(); // element call came from
var tgt = a.shift(); // element to write value to
var oD = document.create Element('div');
var oP = document.create Element('p');
oD.className = 'pDiv';
oP.className = 'pHead';
oP.appendChild( document.create TextNode(a.shif t()));
oD.appendChild( oP);

i = a.length;
while (i--){
oI = document.create Element('input' );
oI.type = 'checkbox';
oI.value = a[0];
oI.onclick = function () {confClick(this ,tgt)};
oD.appendChild( oI);
oD.appendChild( document.create TextNode(a.shif t()));
oD.appendChild( document.create Element('br'));
}
oD.style.top = tgt.offsetTop + 20 + 'px';
oD.style.left = tgt.offsetLeft + 'px';
document.body.a ppendChild(oD);
}

function confClick(x,tgt ){
tgt.value = x.value;
var z = x.parentNode;
z.parentNode.re moveChild(z);
}

</script>
<div style="position : relative; height: 100px"></div>
<form action="">
<input type="text" name="inA" value="blah" size="20"
onblur="confirm (this,this.form .confA,
'Is this chargeable?','y es','no','maybe ');">
<input type="input" name="confA" size="5"><br>
<input type="reset">
</form>


--
Rob
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1414
by: nt9 | last post by:
I am very new with php so excuse me please if the question seems really easy.I have a page(form) which displays a list of the titles of some books(retreived from a database) and each title has a selection box with option values 1 to 7 each.The user should be able to enter 7 choices of his favourite books and store them in the database at a...
6
2985
by: Mica Cooper | last post by:
Hi, I have a series of Select menus on a page. I am trying to allow the user to click on the Select title and have it popup a help window. This works fine with the following code except that all the Select choices are lost. <A HREF="javascript:location='menu.jsp';window.open('menuhelp.jsp?menuID=5','me nuhelp',)">MenuTitle</A> I saw an...
9
1719
by: Coleen | last post by:
I'm using MS .Net Version 7, using VB .Net working on a "simple" web page. All I want to do is display a messagebox. I tried using Messagebox.Show, and get an error that Messagebox has not been declared. I tried using MsgBox (like we used in VB 6) but this throws application errors every time I run it I get the error "It is in valid to show...
6
1721
by: apngss | last post by:
When an application needs to get information from another machine over the network, how many distributed computing choices out there? Here are the choices I know of, classifying by different programming languages HTTP (any??) RPC (C, C++) ..NET (Microsoft)
1
1357
by: John Baker | last post by:
Suppose I am exploring an unknown form programatically through VBA, and I have run across a control I have determined is a combo box. Is there a way to tell if the combo choices are restricted to list, and can I tell what those choices are?
6
1579
by: InDeSkize | last post by:
I'm in the middle of building a database in access 2002 for a client of mine. I just wanted to know what my choices were to make this database accessable from multiple clients at once. His network is a windows 2000 domain with about 8 workstations that will use this database. I read about an MDE file, but I when i tried to make it froze...
9
1672
by: Rhino | last post by:
How hard (and desireable) would it be to give the user certain choices when it comes to printing web pages? The pages on my site use colours and pictures and contain an imbedded menu, among other things. Now, I could make certain assumptions on the user's behalf, such as making the background white and the text black, suppressing the menu...
4
1906
by: wideasleep | last post by:
Hello everyone, I am looking for a way to remove choices from cascading combo boxes as each selection is made. Here's how this is laid out. The initial combo box is STAGE and it will have choices STAGE1, STAGE2, STAGE3 and that will cascade to the CODE combo box. The CODE selections will also have lb. amounts for each code item. For...
5
2037
by: vajra1987 | last post by:
Hello everybody I am working on a Website built on JSP and Servlets . one of the features of the site is to give user the chance to subscribe to different newsletters under different categories. So for example, user1 surfs to the page which displays category sport and under that some options (check boxes) and he can choose zero or more, and...
1
1510
by: jej1216 | last post by:
Background: I have an PHP form that inserts data into a MySQL DB, and it works. Severity of Incident: <select name="severity" size="1"> <option value="">Select a Severity Option</option> <option value="Level1 - No Obvious Harm">Level 1 - No Obvious Harm</option> <option value="Level2 - Non-permanent Harm">Level 2 - Non-permanent...
0
7633
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7785
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7395
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5935
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5310
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3425
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1851
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
997
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
679
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.